package cn.edu.qzuie.artist.module.td.dal.mysql.department;

import java.util.*;

import cn.edu.qzuie.artist.framework.common.pojo.PageResult;
import cn.edu.qzuie.artist.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.edu.qzuie.artist.framework.mybatis.core.mapper.BaseMapperX;
import cn.edu.qzuie.artist.module.td.dal.dataobject.department.DepartmentDO;
import org.apache.ibatis.annotations.Mapper;
import cn.edu.qzuie.artist.module.td.controller.admin.department.vo.*;

/**
 * 部门 Mapper
 *
 * @author 泉信管理员
 */
@Mapper
public interface DepartmentMapper extends BaseMapperX<DepartmentDO> {

    default PageResult<DepartmentDO> selectPage(DepartmentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DepartmentDO>()
                .likeIfPresent(DepartmentDO::getDepartName, reqVO.getDepartName())
                .eqIfPresent(DepartmentDO::getSchoolId, reqVO.getSchoolId())
                .orderByAsc(DepartmentDO::getId));
    }

}